package gui2.g1;

import java.util.List;

import javax.swing.table.DefaultTableModel;

public class ChatTableModel extends DefaultTableModel implements ChatListener {

	@Override
	public void messageAdded(List<ChatMessage> currentMessages) {
		ChatMessage m = currentMessages.get(currentMessages.size()-1);
		addRow(new Object[]{m.getUsername(),m.getMessage()});
	}
	
	@Override
	public int getColumnCount() {
		return 2;
	}
}
